package_group(
    name = "android_cuttlefish",
    packages = [
        "//...",
    ],
)

package(
    default_visibility = ["//:android_cuttlefish"],
)

exports_files([".clang-tidy"])

genrule(
    name = "build_compilation_mode_txt",
    outs = ["build/compilation_mode.txt"],
    cmd = "echo $(COMPILATION_MODE) > $@",
)

filegroup(
    name = "clang_tidy_config",
    srcs = [
        ".clang-tidy",
        "//cuttlefish/host/commands/cvd/cli/commands:.clang-tidy",
        "//cuttlefish/host/commands/kernel_log_monitor:.clang-tidy",
        "//cuttlefish/host/commands/mkenvimage_slim:.clang-tidy",
        "//cuttlefish/host/commands/run_cvd/launch:.clang-tidy",
        "//cuttlefish/host/libs/config:.clang-tidy",
        "//cuttlefish/host/libs/web:.clang-tidy",
    ],
)

cc_library(
    name = "fruit-headers",
    hdrs = ["fruit-config-base.h"],
    # Load-bearing so that angle bracket includes work. See
    # https://stackoverflow.com/a/51441444
    include_prefix = "fruit/impl",
    visibility = ["//visibility:public"],
)

sh_binary(
    name = "gen_ffi_header",
    srcs = ["gen_ffi_header.sh"],
    visibility = ["//visibility:public"],
)

# for crosvm/jail. Has to be in the base repository, as the @crosvm repository isn't visible.
#
# Collections of python files can be combined into a zip file. The python
# interpreter can execute these zip files. Zip files are identified by a suffix
# rather than a prefix, so we can prepend '#!/usr/bin/python' to make the zip
# archive into an executable that automatically invokes the system python to
# run it.
genrule(
    name = "compile_seccomp_policy_exe",
    srcs = ["@crosvm//:compile_seccomp_policy_zip"],
    outs = ["compile_seccomp_policy.py"],
    cmd = "cat <(echo \"#!/usr/bin/python3\n\") $(location @crosvm//:compile_seccomp_policy_zip) > \"$@\"",
    executable = True,
    visibility = ["//visibility:public"],
)

# for crosvm/third_party/minijail/rust/minijail
alias(
    name = "minijail_sources",
    actual = "@crosvm//:minijail_sources",
    visibility = ["//visibility:public"],
)

# Create an alias so that crosvm's rutabaga_gfx crate has visibility into the
# gfxstream repository.
alias(
    name = "gfxstream_backend",
    actual = "@gfxstream//host:gfxstream_backend",
    visibility = ["//visibility:public"],
)

# Useful for `rust_library()`s which can not directly depend on a `cc_shared_library()`.
# TODO: remove after ag/33719949 and update alias above to reference directly.
cc_import(
    name = "gfxstream_backend_import",
    shared_library = ":gfxstream_backend",
    visibility = ["//visibility:public"],
)
